package charles.testproject.googleapi;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.nio.ByteBuffer;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Vector;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.log4j.Logger;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import com.sun.net.ssl.HttpsURLConnection;


public class GoogleMapHttp {
	public static void main(String[] args) {
		URL myURL = null;
		try {
			myURL = new URL(
					"http://maps.google.com/maps/geo?output=csv&key=abcdef&q=37.7583333,122.4138889");
		} catch (MalformedURLException e) {
			e.printStackTrace();
		}
		URLConnection httpsConn = null;
		try {
			httpsConn = (URLConnection) myURL.openConnection();

			InputStreamReader insr = new InputStreamReader(httpsConn
					.getInputStream());
			int respInt = insr.read();
			System.out.println("charles0731...Location info : ");
			while (respInt != -1) {
				System.out.print((char) respInt);
				respInt = insr.read();
			}
			System.out.println("\n");
		} catch (IOException e) {
			e.printStackTrace();
		}
	
	}
}
